package com.ewhale.feitengguest.ui.user.mine.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ewhale.feitengguest.R;
import com.simga.library.adapter.recyclerview.BaseViewHolder;
import com.simga.library.adapter.recyclerview.MutiRecyclerAdapter;
import com.simga.library.utils.glide.GlideUtil;

import java.util.List;

import butterknife.BindView;

public class ShowImageAdapter extends MutiRecyclerAdapter<String> {

    private boolean isShowShili;

    public ShowImageAdapter(List<String> data, boolean isShowShili) {
        super(data, R.layout.item_show_pic);
        this.isShowShili = isShowShili;
    }

    @Override
    protected BaseViewHolder<String> getViewHolder() {
        return new ViewHolder(view);
    }

    class ViewHolder extends BaseViewHolder<String> {
        @BindView(R.id.image)
        ImageView mImage;
        @BindView(R.id.tv_shilitu)
        TextView tvShilitu;

        public ViewHolder(View itemView) {
            super(itemView);
        }

        @Override
        public void build(String object, int position) {
            if(isShowShili){
                tvShilitu.setVisibility(View.VISIBLE);
                GlideUtil.loadPicture(object, mImage, R.drawable.default_image);
            }else{
                tvShilitu.setVisibility(View.GONE);
                GlideUtil.loadRoundPicture(object, mImage, R.drawable.default_image);
            }
        }
    }
}
